package yibao.youyun.com.yibao.Adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import yibao.youyun.com.yibao.Fragment.HomeFragment;
import yibao.youyun.com.yibao.Fragment.PerfromResFragment;

/**
 * Created by woodnaonly on 2015/11/20.
 * 主页面
 */
public class FramentAdapter extends FragmentPagerAdapter
{
    private String[] mTitle = {"首页","演艺资源", "娱乐新闻", "创意工坊", "票务空间"};

    @Override
    public CharSequence getPageTitle(int position)
    {
        return mTitle[position];
    }

    public FramentAdapter(FragmentManager fm)
    {
        super(fm);
    }

    @Override
    public Fragment getItem(int position)
    {
        Fragment mFragment=null;
        switch (position)
        {
            case 0:mFragment=new HomeFragment();break;
            case 1:mFragment=new PerfromResFragment();break;
            case 2:mFragment=new Fragment();break;
            case 3:mFragment=new Fragment();break;
            case 4:mFragment=new Fragment();break;
        }
        return mFragment;
    }

    @Override
    public int getCount()
    {
        return mTitle.length;
    }



}
